//
//  OPublishInfo.m
//  OFootball
//
//  Created by Hauler Lord on 15/9/23.
//  Copyright (c) 2015年 上官千城. All rights reserved.
//

#import "OPublishInfo.h"

@implementation OPublishInfo


-(instancetype) initWithCallBack:(SEL)callBack for:(NSObject *)recvObjc
{
    return [super initWithName:@"OAddUserInformation" recvObjc:recvObjc callBack:callBack];
}
-(void) request
{
    NSDictionary* params = @{
        @"content":self.content
    };
    
    [self send:params];
}

-(void) run:(NSData *)data erc:(NSInteger)erc
{
    if (erc != SUCC) {
        //TODO:fail logic process;
        NSString *str = [NSString stringWithFormat:@"发布失败erc= %ld",erc];
        UIAlertView *failAlert = [[UIAlertView alloc] initWithTitle:@"提示" message:str delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
        [failAlert show];
        return;
    }
    
    NSDictionary* dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
    self.answerData  = [NSDictionary dictionary];
    self.answerData = dic;
    NSLog(@"publishNews == %@",self.answerData);
    
    
    //TODO:succ logic process;
    /* if (muDelegate) {
     muDelegate(self);
     }*/
    [self mu];
}

@end
